package cn.parus.auth.POJO.DTO;

import java.util.List;
import java.util.Map;

public class OpaInput {
    private String userId;
    private String roles;
    private Long expirationTime;

    // 构造函数，用于填充 OpaInput
    public OpaInput(Map<String, Object> claimsMap) {
        // 从 claimsMap 提取不同的值
        this.userId = (String) claimsMap.get("sub"); // 假设 "sub" 存储用户ID
        this.roles = (String) claimsMap.get("role"); // 假设 "roles" 存储用户角色
        this.expirationTime = (Long) claimsMap.get("exp"); // 假设 "exp" 存储过期时间
    }

    // Getters 和 Setters
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getRoles() {
        return roles;
    }

    public void setRoles(String roles) {
        this.roles = roles;
    }

    public Long getExpirationTime() {
        return expirationTime;
    }

    public void setExpirationTime(Long expirationTime) {
        this.expirationTime = expirationTime;
    }

}
